package com.cj.webapp.account.controller;

import com.cj.webapp.account.pojo.ConstantParamter;
import com.cj.webapp.account.pojo.MemberInfo;
import com.cj.webapp.common.utils.MapDetail;
import com.cj.webapp.common.utils.http.HttpsUtil;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * 查询用户信息
 * Created by dell on 2017/12/25.
 */

//@WebServlet(name = "AccountServlet",urlPatterns ={"/account"})
public class Recharge_WithdrawServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        //HttpSession session = request.getSession();

        //HttpSession session2=(HttpSession) (HttpSession) MapDetail.resMap.get(request.getParameter("sessionId"));
       /* if(session2!=null){
            session= (HttpSession) MapDetail.resMap.get(request.getParameter("sessionId"));
        }*/


        HttpsUtil httpsUtil=new HttpsUtil();
        String urlString= ConstantParamter.DIRECT_WAY_URL;
        Map<String,Object> map=new HashMap<>();
        map.put("sessionId",MapDetail.resMap.get("sessionId").toString());
        map.put("token",MapDetail.resMap.get("token").toString());
        map.put("platfmCustId",MapDetail.resMap.get("platfmCustId").toString());
        map.put("source",MapDetail.resMap.get("source").toString());
        map.put("role",MapDetail.resMap.get("role"));
        List<MemberInfo> memberInfoList=httpsUtil.sendUserList(map, urlString);
        request.setAttribute("list",memberInfoList);

        request.getRequestDispatcher("/page/mobile/mobileRecharge_Withdraw/recharge_Withdraw.jsp").forward(request,response);


    }
    
}
